home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Snippets / ShowHelp / main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-06  |  1.1 KB  |  47 lines  |  [TEXT/KAHL]

  1. #define REMOVE_ALL_EVENTS 0
  2. #define NIL                0L
  3.  
  4. void ToolBoxInit( void );
  5. void main( void );
  6.  
  7. /* ------------------------------------------------------------------ */
  8. void main()
  9. {
  10.     pascal void (*Show_help)( short info_id,
  11.                                 pascal void (*UpdateProc)(WindowPtr) );
  12.     Handle    help_CUST;
  13.     
  14.     EventRecord    the_event;
  15.     MenuHandle    apple_menu;
  16.  
  17.     ToolBoxInit();
  18.     
  19.     MaxApplZone();
  20.     EventAvail( everyEvent, &the_event ); /* Move to the foreground */
  21.     EventAvail( everyEvent, &the_event ); /* Move to the foreground */
  22.     EventAvail( everyEvent, &the_event ); /* Move to the foreground */
  23.     
  24.     apple_menu = NewMenu( 1, "\p\024" );
  25.     InsertMenu( apple_menu, 0 );
  26.     DrawMenuBar();
  27.     
  28.     help_CUST = Get1NamedResource( 'CUST', "\pShow_help" );
  29.     HLock( help_CUST );
  30.     Show_help = (pascal void (*)( short, pascal void (*)(WindowPtr) ))
  31.         StripAddress( *help_CUST );
  32.     (*Show_help)( 128, NIL );
  33. }
  34.  
  35. /* ------------------------------------------------------------------ */
  36. void ToolBoxInit()
  37. {
  38.     InitGraf( &thePort );
  39.     InitFonts();
  40.     FlushEvents( everyEvent, REMOVE_ALL_EVENTS );
  41.     InitWindows();
  42.     InitMenus();
  43.     TEInit();
  44.     InitDialogs( NIL );
  45.     InitCursor();
  46. }
  47.